package protect_thread;

public class testdemo {
    public static void main(String[] args) {
        Mythread01 m1 = new Mythread01();
        Mythread02 m2 = new Mythread02();

        Thread t1 = new Thread(m1,"女神");
        Thread t2 = new Thread(m2,"备胎");

        //将备胎设置为守护线程，当女生线程结束后，备胎线程会陆陆续续的结束，并不一定要执行完，
        // 例如qq聊天中传送文件，当对话框关闭，传送文件也会终止
        t2.setDaemon(true);
        t1.start();
        t2.start();
    }
}
